<?php

namespace App\Support;

class Data
{

    /**
     * 返回时间尺度.
     *
     * @return string[]
     */
    public static function timeScales(): array
    {
        return [
            'day' => '天',
            'month' => '月',
            'year' => '年',
        ];
    }
    /**
     * 成功或失败.
     *
     * @return string[]
     */
    public static function successOrFail(): array
    {
        return ['失败', '成功'];
    }

    /**
     * 性别
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-06-19
     * @return void
     */
    public static function getSex()
    {
        return [1 => '男', 2 => '女'];
    }

    /**
     * hp检查方法单选
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-08-29
     * @return void
     */
    public static function getHpCheckMethod()
    {
        return [
            1 => '13C-UBT',
            2 => '14C-UBT',
            3 => '快速尿素酶试验',
            4 => '胃黏膜组织RUT',
            5 => '其他',
        ];
    }

    /**
     * hp检查结果
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-08-29
     * @return void
     */
    public static function getHpCheckResult()
    {
        return [
            1 => 'Hp 阳性',
            2 => 'Hp 阴性',
        ];
    }

    /**
     * 疾病诊断
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-08-29
     * @return void
     */
    public static function getDiseaseDiagnosis()
    {
        return [
            1 => '慢性浅表性胃炎',
            2 => '慢性萎缩性胃炎',
            3 => '功能性消化不良',
            4 => '消化性溃疡',
            5 => '胃食管反流',
            6 => '其他',
        ];
    }

    public static function getGastroscopyDiagnosis()
    {
        return [
            1 => '开展内镜',
            2 => '未开展内镜检查',
        ];
    }

    public static function getCaseDiagnosis()
    {
        return [
            1 => '开展病理检查',
            2 => '未开展病理检查',
        ];
    }


    /**
     * 不良反应
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-06-19
     * @return void
     */
    public static function getAdverseReactions()
    {
        return [
            1 => '头痛',
            2 => '头晕',
            3 => '恶心',
            4 => '呕吐',
            5 => '腹泻',
            6 => '肌痛',
            7 => '关节痛',
            8 => '骨痛',
            9 => '背痛',
            10 => '寒颤',
            11 => '疲劳',
            12 => '乏力',
            13 => '疼痛',
            14 => '肢体疼痛',
            15 => '流感样疾病',
            16 => '其他',
        ];
    }
    /**
     * 不良反应程度
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-06-19
     * @return void
     */
    public static function getAdverseReactionsSeverity()
    {
        return [
            1 => '轻度',
            2 => '中度',
            3 => '重度',
        ];
    }

    /**
     * 是否与观察药物相关
     *
     * @Author hechengwei
     * @email chichiooo@sina.com
     * @DateTime 2024-06-19
     * @return void
     */
    public static function getIsRelated()
    {
        return [
            1 => '肯定',
            2 => '很可能',
            3 => '可能',
            4 => '可能无关',
            5 => '待评价',
            6 => '无法评价',
        ];
    }


    public static function splitData($options, $data, $key, $input)
    {
        $result = [];
        foreach (explode(',', $data) as $v) {
            // 如果有其他
            if ($v == $key) {
                array_push($result, isset($options[$v]) ? $options[$v] : '');
                array_push($result, $input);
            } else {
                array_push($result, isset($options[$v]) ? $options[$v] : '');
            }
        }
        return $result;
    }


    public static function cate1()
    {
        return [1 => '无', 2 => '偶尔', 3 => '有时', 4 => '经常', 5 => '总是'];
    }

    public static function cate2()
    {
        return [1 => '无', 2 => '轻微', 3 => '中度', 4 => '重度'];
    }

    public static function cate3()
    {
        return [1 => '正常', 2 => '不正常'];
    }
}
